﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using MVCBug.Models;

namespace MVCBug.Controllers
{
    public class TaskController : Controller
    {
        //
        // GET: /Task/
        private DataManager _dataManager;

        public TaskController(DataManager dataManager)
        {
            _dataManager = dataManager;
        }

        public ActionResult List()
        {
            ViewData["Title"] = "Task List";
            ViewData["Tasks"] = _dataManager.Tasks.GetTasks();

            return View();
        }

        public ActionResult Task(int id)
        {
            ViewData.Model = _dataManager.Tasks.GetTask(id);

            return View();

        }
        
    }
}
